package weeklyreport

class Task {
	String issueNumber
	String groupName
	String itsmNumber
	String status
	Date planningBegin
	Date planningEnd
	Date beginDate
	Date endDate
	String internalVersion
	User developer
	String description
	BigDecimal planningManDay
	BigDecimal manDay

	String smNumber
	String reqEmpNumber
	String devEmpNumber
	String crNumber
	String lateState
	String planningClose
	String closeDate
	String internalTest
	String needTS
	String consultant
	String tester
	String reqName
	String remark

	static belongsTo = [developer:User]

	static constraints = {
		issueNumber(blank:false,nullable:false,unique:true)
		groupName(blank:true,nullable:true)
		itsmNumber(blank:true,nullable:true)
		status(inList:["完成", "待开发", "开发中"])
		planningBegin(blank:true,nullable:true)
		beginDate(blank:true,nullable:true)
		planningEnd(blank:true,nullable:true)
		endDate(blank:true,nullable:true)
		internalVersion(blank:true,nullable:true)
		developer(validator:{it.role == "user"})
		description(blank:true,nullable:true)
		planningManDay(blank:true,nullable:true)
		manDay(blank:true,nullable:true)
		smNumber(blank:true,nullable:true)
		reqEmpNumber(blank:true,nullable:true)
		devEmpNumber(blank:true,nullable:true)
		crNumber(blank:true,nullable:true)
		lateState(blank:true,nullable:true)
		planningClose(blank:true,nullable:true)
		closeDate(blank:true,nullable:true)
		internalTest(blank:true,nullable:true)
		needTS(blank:true,nullable:true)
		consultant(blank:true,nullable:true)
		tester(blank:true,nullable:true)
		reqName(blank:true,nullable:true)
		remark(blank:true,nullable:true)
	}
	
	static mapping = {
		sort "planningBegin"
	}

	String toString() {
		"${issueNumber} ${description}"
	}
}
